package com.xuln.ipp.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;

import org.compass.annotations.Index;
import org.compass.annotations.SearchableProperty;
import org.compass.annotations.Store;

import com.xuln.common.category.entity.Category;
import com.xuln.framework.entity.BaseEntity;

@Entity
public class Article extends BaseEntity {
	private static final long serialVersionUID = 6483725378110660420L;
	@SearchableProperty(store = Store.YES)
	@Column(nullable = false)
	private String title;
	@SearchableProperty(index = Index.NO, store = Store.YES)
	private String author;// 作者
	@SearchableProperty(store = Store.YES)
	@Column(length = 5000, nullable = false)
	private String content;// 内容
	@Column(length = 5000)
	private String metaKeywords;// 页面关键词
	@Column(length = 5000)
	private String metaDescription;// 页面描述
	@SearchableProperty(store = Store.NO)
	@Column(nullable = false)
	private Boolean isPublication = true;// 是否发布
	@SearchableProperty(store = Store.NO)
	@Column(nullable = false)
	private Boolean isTop = false;// 是否置顶
	@SearchableProperty(store = Store.NO)
	@Column(nullable = false)
	private Boolean isRecommend = false;// 是否为推荐文章
	@SearchableProperty(store = Store.YES)
	@JoinColumn(nullable = false, updatable = false)
	private String htmlFilePath;// HTML静态文件路径（首页）
	@Column(nullable = false)
	private Integer hits = 0;// 点击数
	@Column(nullable = false)
	private Long categoryId;

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getMetaKeywords() {
		return metaKeywords;
	}

	public void setMetaKeywords(String metaKeywords) {
		this.metaKeywords = metaKeywords;
	}

	public String getMetaDescription() {
		return metaDescription;
	}

	public void setMetaDescription(String metaDescription) {
		this.metaDescription = metaDescription;
	}

	public Boolean getIsPublication() {
		return isPublication;
	}

	public void setIsPublication(Boolean isPublication) {
		this.isPublication = isPublication;
	}

	public Boolean getIsTop() {
		return isTop;
	}

	public void setIsTop(Boolean isTop) {
		this.isTop = isTop;
	}

	public Boolean getIsRecommend() {
		return isRecommend;
	}

	public void setIsRecommend(Boolean isRecommend) {
		this.isRecommend = isRecommend;
	}

	public String getHtmlFilePath() {
		return htmlFilePath;
	}

	public void setHtmlFilePath(String htmlFilePath) {
		this.htmlFilePath = htmlFilePath;
	}

	public Integer getHits() {
		return hits;
	}

	public void setHits(Integer hits) {
		this.hits = hits;
	}

	public Long getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}

}
